<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>绿能智链 - 启动页</title>
    <link href="https://cdn.jsdelivr.net/npm/tailwindcss@2.2.19/dist/tailwind.min.css" rel="stylesheet">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css">
    <style>
        body {
            margin: 0;
            overflow: hidden;
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
            background: linear-gradient(135deg, #1a8754, #0d6e3d);
            height: 100vh;
            color: white;
        }
        .splash-container {
            height: 100vh;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            position: relative;
            transform: translateY(0);
            transition: transform 0.5s ease-out;
        }
        .splash-logo {
            width: 120px;
            height: 120px;
            background: rgba(255, 255, 255, 0.1);
            border-radius: 30px;
            display: flex;
            align-items: center;
            justify-content: center;
            margin-bottom: 24px;
            animation: logoAppear 1s ease-out;
        }
        .splash-title {
            font-size: 28px;
            font-weight: bold;
            margin-bottom: 12px;
            opacity: 0;
            animation: fadeIn 1s ease-out 0.5s forwards;
        }
        .splash-subtitle {
            font-size: 16px;
            opacity: 0.8;
            opacity: 0;
            animation: fadeIn 1s ease-out 0.7s forwards;
        }
        .swipe-indicator {
            position: absolute;
            bottom: 60px;
            display: flex;
            flex-direction: column;
            align-items: center;
            opacity: 0;
            animation: fadeIn 1s ease-out 1.2s forwards;
        }
        .swipe-text {
            margin-bottom: 8px;
            font-size: 14px;
            opacity: 0.8;
        }
        .swipe-arrow {
            animation: bounce 2s infinite;
        }
        @keyframes logoAppear {
            0% {
                transform: scale(0.5);
                opacity: 0;
            }
            100% {
                transform: scale(1);
                opacity: 1;
            }
        }
        @keyframes fadeIn {
            0% {
                opacity: 0;
                transform: translateY(20px);
            }
            100% {
                opacity: 1;
                transform: translateY(0);
            }
        }
        @keyframes bounce {
            0%, 20%, 50%, 80%, 100% {
                transform: translateY(0);
            }
            40% {
                transform: translateY(-10px);
            }
            60% {
                transform: translateY(-5px);
            }
        }
        .energy-particles {
            position: absolute;
            width: 100%;
            height: 100%;
            pointer-events: none;
        }
        .particle {
            position: absolute;
            background: rgba(255, 255, 255, 0.2);
            border-radius: 50%;
            animation: float 3s infinite;
        }
        @keyframes float {
            0% {
                transform: translateY(0) rotate(0deg);
                opacity: 0;
            }
            50% {
                opacity: 0.5;
            }
            100% {
                transform: translateY(-100vh) rotate(360deg);
                opacity: 0;
            }
        }
    </style>
</head>
<body>
    <div class="splash-container" id="splashContainer">
        <div class="energy-particles" id="particles"></div>
        <div class="splash-logo">
            <i class="fas fa-leaf fa-3x"></i>
        </div>
        <h1 class="splash-title">绿能智链</h1>
        <p class="splash-subtitle">连接绿色能源的未来</p>
        <div class="swipe-indicator">
            <span class="swipe-text">向上滑动进入应用</span>
            <i class="fas fa-chevron-up swipe-arrow"></i>
        </div>
    </div>

    <script>
        // 创建能量粒子效果
        function createParticles() {
            const container = document.getElementById('particles');
            for (let i = 0; i < 20; i++) {
                const particle = document.createElement('div');
                particle.className = 'particle';
                particle.style.left = Math.random() * 100 + '%';
                particle.style.top = Math.random() * 100 + '%';
                particle.style.width = Math.random() * 10 + 5 + 'px';
                particle.style.height = particle.style.width;
                particle.style.animationDelay = Math.random() * 2 + 's';
                container.appendChild(particle);
            }
        }

        // 处理滑动手势
        let startY = 0;
        let currentY = 0;

        document.addEventListener('touchstart', (e) => {
            startY = e.touches[0].clientY;
        });

        document.addEventListener('touchmove', (e) => {
            currentY = e.touches[0].clientY;
            const diff = startY - currentY;
            if (diff > 0) {
                const transform = Math.min(diff / 2, 100);
                document.getElementById('splashContainer').style.transform = `translateY(-${transform}%)`;
            }
        });

        document.addEventListener('touchend', () => {
            const diff = startY - currentY;
            if (diff > 100) {
                // 完成向上滑动，跳转到主页
                window.location.href = 'home.html';
            } else {
                // 重置位置
                document.getElementById('splashContainer').style.transform = 'translateY(0)';
            }
        });

        // 初始化粒子效果
        createParticles();
    </script>
</body>
</html>